package Template::Plugin::DataSemantic;

use strict;
use warnings;


our $VERSION = '0.03';


use base 'Template::Plugin';


sub base_class_from_companion_class {
    my ($self, $package) = @_;
    $package =~ s/_TEST$//;
    $package;
}


sub base_class_from_testdata_class {
    my ($self, $package) = @_;
    $package =~ s/TestData:://;
    $package;
}


sub companion_class_from_base_class {
    my ($self, $package) = @_;
    $package . '_TEST';
}


sub testdata_class_from_base_class {
    my ($self, $package) = @_;
    my @parts = split /::/, $package;
    splice @parts, -1, 0, 'TestData';
    join '::' => @parts;
}


1;
